/**
 * author:Administrator
 * date:2013-5-21
 */
package com.roc.web.action.terminal;

import java.sql.Date;
import java.util.ArrayList;
import java.util.List;

import com.roc.page.BaseSearchCondition;
import com.roc.page.WhereHQLFieldBean;
import com.roc.util.Constance;

/**
 * 
 * @author 陈锴
 * 
 * 终端序列号添加
 * 
 * 2014-08-18
 *
 */
public class TerminalSnQuerySearchCondition extends BaseSearchCondition {
	

	private String orgCode;
	private String posBrand;  //品牌
	private String posType;  //机型
	
	

	/* (non-Javadoc)
	 * @see com.roc.page.BaseSearchCondition#getOrderPartOfHQL()
	 */
	@Override
	protected String getOrderPartOfHQL() {
		// TODO Auto-generated method stub
		
		return " ORDER BY y.dtCreate DESC ";
	}

	/* (non-Javadoc)
	 * @see com.roc.page.BaseSearchCondition#getRowCountHQL()
	 */
	@Override
	protected String getRowCountHQL() {//,OrgBean o  t.orgCode = o.org_code
		
		return " SELECT COUNT(*) FROM YjPosInfo y WHERE y.isBind = 'N' ";
	}

	/* (non-Javadoc)
	 * @see com.roc.page.BaseSearchCondition#getSearchHQL()
	 */
	@Override
	protected String getSearchHQL() {
		
		return " FROM YjPosInfo y WHERE y.isBind = 'N' ";
	}

	/* (non-Javadoc)
	 * @see com.roc.page.BaseSearchCondition#getWhereHQLFieldBeanList()
	 */
	@Override
	protected List<WhereHQLFieldBean> getWhereHQLFieldBeanList() {
		List<WhereHQLFieldBean> filedBeanList = new ArrayList<WhereHQLFieldBean>();

		
		if (Constance.isNotEmpty(orgCode)) {
			filedBeanList.add(new WhereHQLFieldBean("y.orgCode", orgCode, "=", false));
		}

		if (Constance.isNotEmpty(posBrand)) {
			filedBeanList.add(new WhereHQLFieldBean("y.posBrand", posBrand, "=", false));
		}
		if (Constance.isNotEmpty(posType)) {
			filedBeanList.add(new WhereHQLFieldBean("y.posType", posType, "=", false));
		}
		
		return filedBeanList;
	}


	public String getOrgCode() {
		return orgCode;
	}

	public void setOrgCode(String orgCode) {
		this.orgCode = orgCode;
	}

	public String getPosBrand() {
		return posBrand;
	}

	public void setPosBrand(String posBrand) {
		this.posBrand = posBrand;
	}

	public String getPosType() {
		return posType;
	}

	public void setPosType(String posType) {
		this.posType = posType;
	}

}
